<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery-1.4.2.js"></script>
</head>
<body>
    <input type="text" name="username" id="username" placeholder="请输入用户名">
    <button onclick="getUserName()">点我一下</button>
</body>
<script>
    function getUserName(){
        var $oIn = $("#username")
        //alert($oIn.val())
        alert($oIn[0].value)
    }
    function getUserName1(){
        var oInput = document.getElementById("username")
        alert($(oInput).val())
    }
</script>
</html>